Skip to content

USHIFT-6588: Improve usability of generate_common_versions.py script#6663

Open
vanhalenar wants to merge 9 commits into
openshift:mainfrom
vanhalenar:manage-common-versions
Open

USHIFT-6588: Improve usability of generate_common_versions.py script#6663
vanhalenar wants to merge 9 commits into
openshift:mainfrom
vanhalenar:manage-common-versions

Conversation

@vanhalenar
Copy link
Copy Markdown
Contributor

@vanhalenar vanhalenar commented May 13, 2026

This PR add the manage_common_versions.sh script, which has two actions, generate and verify. The script takes care of creating the venv for generate_common_versions.py and replaces the common_versions_verify.sh script for verification. This is more in line with other scripts we have, e.g. manage_webserver.sh.

Summary by CodeRabbit

  • Chores
    • CI build flow now includes an explicit pinned-version verification step prior to worker setup and cache/build continuation, improving consistency across builds.
    • Added a command-line utility to verify and regenerate pinned common-version metadata and to generate metadata for a specified version; includes action-driven commands and built-in help for guided usage.

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented May 13, 2026

@vanhalenar: This pull request references USHIFT-6588 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 13, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds test/bin/manage_common_versions.sh with verify and generate actions to centralize generation/verification of test/bin/common_versions.sh. Updates test/bin/ci_phase_iso_build.sh to run manage_common_versions.sh verify instead of sourcing the previous verification script.

Changes

Version management CLI + build integration

Layer / File(s) Summary
CLI entry, usage, dispatch
test/bin/manage_common_versions.sh
New Bash CLI with usage(), argument parsing and dispatch for verify and generate.
verify action: detect & enforce generated file parity
test/bin/manage_common_versions.sh, test/bin/common_versions.sh, test/bin/pyutils/generate_common_versions.py, scripts/pyutils/create-venv.sh
verify computes a git-diff range against ${SCENARIO_BUILD_BRANCH}^1...HEAD to check test/bin/common_versions.sh; if diffs exist it creates a Python venv, runs the generator to (re)create common_versions.sh, and exits non‑zero if regenerated output still differs.
generate action: explicit generation path
test/bin/manage_common_versions.sh, test/bin/pyutils/generate_common_versions.py, scripts/pyutils/create-venv.sh
generate requires a version argument, creates the venv, and invokes the generator with the provided version and extra options to write test/bin/common_versions.sh.
Build script integration
test/bin/ci_phase_iso_build.sh
Replaces sourcing test/bin/common_versions_verify.sh with invoking "$SCRIPTDIR/manage_common_versions.sh" verify as the verification step in the CI ISO build flow.
sequenceDiagram
    participant CI as CI job / ci_phase_iso_build.sh
    participant CLI as manage_common_versions.sh
    participant Git as Git (diff)
    participant Venv as create-venv.sh / Python venv
    participant Gen as generate_common_versions.py
    CI->>CLI: run "verify"
    CLI->>Git: git diff ${SCENARIO_BUILD_BRANCH}^1...HEAD check common_versions.sh
    alt diff found
        CLI->>Venv: create venv
        Venv->>Gen: run generator -> write common_versions.sh
        Gen->>Git: compare regenerated file
        alt still differs
            CLI-->>CI: exit non-zero (failure)
        else
            CLI-->>CI: success, continue
        end
    else
        CLI-->>CI: success, continue
    end
Loading

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 10 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ⚠️ Warning The title references improving usability of generate_common_versions.py, but the main changes involve adding a new manage_common_versions.sh wrapper script and updating ci_phase_iso_build.sh to use it. Revise the title to reflect the primary change: 'Add manage_common_versions.sh wrapper script' or similar, since the script addition is the main deliverable.
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR introduces no Ginkgo tests. Custom check is specific to Ginkgo test naming patterns (It(), Describe(), Context(), etc.) which are not present in modified shell scripts for build CI orchestration.
Test Structure And Quality ✅ Passed This PR modifies only Bash shell scripts (ci_phase_iso_build.sh and manage_common_versions.sh). No Ginkgo or Go test files are present. The check for Ginkgo test quality is not applicable.
Microshift Test Compatibility ✅ Passed PR adds shell scripts only (manage_common_versions.sh, ci_phase_iso_build.sh). No Ginkgo e2e tests added. Check applies only to Ginkgo test additions, so check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No Ginkgo e2e tests added. PR contains only bash shell scripts for CI infrastructure (ci_phase_iso_build.sh and manage_common_versions.sh). SNO compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed Changes are CI shell scripts in test/bin/, not deployment manifests, operator code, or controllers. No Kubernetes scheduling constraints, affinity rules, or topology assumptions present.
Ote Binary Stdout Contract ✅ Passed PR contains only shell scripts, not OTE binaries. The OTE Binary Stdout Contract check applies only to Go test binaries, not CI utility scripts. Check is not applicable.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No Ginkgo e2e tests added in this PR. Changes are shell scripts (ci_phase_iso_build.sh, manage_common_versions.sh) which are not subject to IPv6/disconnected network compatibility check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot requested review from agullon and copejon May 13, 2026 10:17
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/bin/manage_common_versions.sh`:
- Around line 10-13: The git diff invocation is using an unnecessary parent
traversal token (${SCENARIO_BUILD_BRANCH}^1...HEAD) which can misdetect changes;
update the diff command that checks common_versions.sh (the line invoking git
diff --exit-code with ${SCENARIO_BUILD_BRANCH}^1...HEAD and
${ROOTDIR}/test/bin/common_versions.sh) to use ${SCENARIO_BUILD_BRANCH}...HEAD
instead so the three-dot range uses the proper merge-base and accurately detects
PR changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 5398172a-090f-4fd2-806f-f6f9acdbfb4a

📥 Commits

Reviewing files that changed from the base of the PR and between 93f2ef4 and 7f9859e.

📒 Files selected for processing (2)
  • test/bin/ci_phase_iso_build.sh
  • test/bin/manage_common_versions.sh

Comment thread test/bin/manage_common_versions.sh
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/bin/ci_phase_iso_build.sh`:
- Around line 184-186: Update the stale ShellCheck source comment to match the
actual sourced script: replace the SC1091 directive that references
common_versions_verify.sh with one that references manage_common_versions.sh
(the file actually sourced via source "${SCRIPTDIR}/manage_common_versions.sh"
verify) so ShellCheck correctly recognizes the sourced file and stops reporting
SC1091; ensure the comment references the same SCRIPTDIR usage as the source
line.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 38201f04-d793-4ab5-bc94-674d99a6db5a

📥 Commits

Reviewing files that changed from the base of the PR and between e9ceb37 and 26f0440.

📒 Files selected for processing (1)
  • test/bin/ci_phase_iso_build.sh

Comment thread test/bin/ci_phase_iso_build.sh Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
test/bin/ci_phase_iso_build.sh (1)

184-184: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add a ShellCheck source directive for manage_common_versions.sh.

Line 184 still triggers SC1091 without an explicit source hint.

Suggested fix
+# shellcheck source=test/bin/manage_common_versions.sh
 source "${SCRIPTDIR}/manage_common_versions.sh" verify
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/bin/ci_phase_iso_build.sh` at line 184, Add a ShellCheck source
directive above the line that sources manage_common_versions.sh so SC1091 is
silenced: insert a comment like a shellcheck source hint referencing
manage_common_versions.sh immediately before the source
"${SCRIPTDIR}/manage_common_versions.sh" verify line (the line that calls the
script), ensuring ShellCheck can resolve the sourced file.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@test/bin/ci_phase_iso_build.sh`:
- Line 184: Add a ShellCheck source directive above the line that sources
manage_common_versions.sh so SC1091 is silenced: insert a comment like a
shellcheck source hint referencing manage_common_versions.sh immediately before
the source "${SCRIPTDIR}/manage_common_versions.sh" verify line (the line that
calls the script), ensuring ShellCheck can resolve the sourced file.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: a2445143-641b-4a58-aa19-168b58dea41c

📥 Commits

Reviewing files that changed from the base of the PR and between 26f0440 and 461babb.

📒 Files selected for processing (1)
  • test/bin/ci_phase_iso_build.sh

@vanhalenar vanhalenar changed the title USHIFT-6588: Add manage_common_versions.sh script USHIFT-6588: Improve usability of generate_common_versions.py script May 14, 2026
Comment thread test/bin/ci_phase_iso_build.sh Outdated
Comment thread test/bin/manage_common_versions.sh Outdated
Comment thread test/bin/ci_phase_iso_build.sh
Comment thread test/bin/ci_phase_iso_build.sh Outdated
Comment thread test/bin/manage_common_versions.sh Outdated
Comment thread test/bin/manage_common_versions.sh Outdated
@ggiguash
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 14, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 14, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ggiguash, vanhalenar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 14, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 14, 2026

@vanhalenar: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants